.nh
.TH OneX(1) onex User Manuals
Eric Paris
Jan 2015

.SH NAME
.PP
onexctl completion - Output shell completion code for the specified shell (bash, zsh, fish, or powershell)


.SH SYNOPSIS
.PP
\fBonexctl completion\fP [OPTIONS]


.SH DESCRIPTION
.PP
Output shell completion code for the specified shell (bash or zsh). The shell code must be evaluated to provide interactive completion of onexctl commands.  This can be done by sourcing it from the .bash_profile.

.PP
Detailed instructions on how to do this are available here: http://github.com/superproj/onex/docs/installation/onexctl.md#enabling-shell-autocompletion

.PP
Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2


.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB--alsologtostderr\fP=false
	log to standard error as well as files

.PP
\fB--config\fP=""
	Path to the config file to use for CLI.

.PP
\fB--gateway.address\fP=""
	The address and port of the OneX API server

.PP
\fB--gateway.certificate-authority\fP=""
	Path to a cert file for the certificate authority

.PP
\fB--gateway.insecure-skip-tls-verify\fP=false
	If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure

.PP
\fB--gateway.max-retries\fP=0
	Maximum number of retries.

.PP
\fB--gateway.retry-interval\fP=0s
	The interval time between each attempt.

.PP
\fB--gateway.timeout\fP=0s
	The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.

.PP
\fB--kubeconfig\fP=""
	Paths to a kubeconfig. Only required if out-of-cluster.

.PP
\fB--log-backtrace-at\fP=
	when logging hits line file:N, emit a stack trace

.PP
\fB--log-dir\fP=""
	If non-empty, write log files in this directory

.PP
\fB--log-link\fP=""
	If non-empty, add symbolic links in this directory to the log files

.PP
\fB--logbuflevel\fP=0
	Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod platforms.

.PP
\fB--logtostderr\fP=false
	log to standard error instead of files

.PP
\fB--profile\fP="none"
	Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)

.PP
\fB--profile-output\fP="profile.pprof"
	Name of the file to write the profile to

.PP
\fB--stderrthreshold\fP=2
	logs at or above this threshold go to stderr

.PP
\fB--user.client-certificate\fP=""
	Path to a client certificate file for TLS

.PP
\fB--user.client-key\fP=""
	Path to a client key file for TLS

.PP
\fB--user.password\fP=""
	Password for basic authentication to the API server

.PP
\fB--user.secret-id\fP=""
	SecretID for JWT authentication to the API server

.PP
\fB--user.secret-key\fP=""
	SecretKey for jwt authentication to the API server

.PP
\fB--user.token\fP=""
	Bearer token for authentication to the API server

.PP
\fB--user.username\fP=""
	Username for basic authentication to the API server

.PP
\fB--usercenter.address\fP=""
	The address and port of the OneX API server

.PP
\fB--usercenter.certificate-authority\fP=""
	Path to a cert file for the certificate authority

.PP
\fB--usercenter.insecure-skip-tls-verify\fP=false
	If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure

.PP
\fB--usercenter.max-retries\fP=0
	Maximum number of retries.

.PP
\fB--usercenter.retry-interval\fP=0s
	The interval time between each attempt.

.PP
\fB--usercenter.timeout\fP=0s
	The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.

.PP
\fB-v\fP, \fB--v\fP=0
	log level for V logs

.PP
\fB--version\fP=false
	Print version information and quit

.PP
\fB--vmodule\fP=
	comma-separated list of pattern=N settings for file-filtered logging

.PP
\fB--warnings-as-errors\fP=false
	Treat warnings received from the server as errors and exit with a non-zero exit code


.SH EXAMPLE
.PP
.RS

.nf
  # Installing bash completion on macOS using homebrew
  ## If running Bash 3.2 included with macOS
  brew install bash-completion
  ## or, if running Bash 4.1+
  brew install bash-completion@2
  ## If onexctl is installed via homebrew, this should start working immediately.
  ## If you've installed via other means, you may need add the completion to your completion directory
  onexctl completion bash > $(brew --prefix)/etc/bash_completion.d/onexctl
  
  
  # Installing bash completion on Linux
  ## If bash-completion is not installed on Linux, please install the 'bash-completion' package
  ## via your distribution's package manager.
  ## Load the onexctl completion code for bash into the current shell
  source <(onexctl completion bash)
  ## Write bash completion code to a file and source if from .bash_profile
  onexctl completion bash > ~/.onex/onexctl.completion.bash.inc
  printf "
  # OneX shell completion
  source '$HOME/.onex/onexctl.completion.bash.inc'
  " >> $HOME/.bash_profile
  source $HOME/.bash_profile
  
  # Load the onexctl completion code for zsh[1] into the current shell
  source <(onexctl completion zsh)
  # Set the onexctl completion code for zsh[1] to autoload on startup
  onexctl completion zsh > "${fpath[1]}/_onexctl"
  
  # Load the onexctl completion code for fish[2] into the current shell
  onexctl completion fish | source
  # To load completions for each session, execute once:
  onexctl completion fish > ~/.config/fish/completions/onexctl.fish
  
  # Load the onexctl completion code for powershell into the current shell
  onexctl completion powershell | Out-String | Invoke-Expression
  # Set onexctl completion code for powershell to run on startup
  ## Save completion code to a script and execute in the profile
  onexctl completion powershell > $HOME\\.onex\\completion.ps1
  Add-Content $PROFILE "$HOME\\.onex\\completion.ps1"
  ## Execute completion code in the profile
  Add-Content $PROFILE "if (Get-Command onexctl -ErrorAction SilentlyContinue) {
  onexctl completion powershell | Out-String | Invoke-Expression
  }"
  ## Add completion code directly to the $PROFILE script
  onexctl completion powershell >> $PROFILE

.fi
.RE


.SH SEE ALSO
.PP
\fBonexctl(1)\fP,


.SH HISTORY
.PP
January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the superproj source material, but hopefully they have been automatically generated since!
